package com.lyz.collectionDemo.collectionSet;

import com.lyz.collectionDemo.collectionSet.Student;

import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName HashDemo1
 * @Description hash
 * @Author 2214361854
 * @Date 2022/2/21 20:13
 * @Version 1.0
 */
public class HashDemo1 {
    public static void main(String[] args) {
        Set<Student> sets = new HashSet<>();
        Student s1 = new Student("小王",20,"男");
        Student s2 = new Student("小王",20,"男");
        Student s3 = new Student("小新",20,"男");

        sets.add(s1);
        sets.add(s2);
        sets.add(s3);

        System.out.println(sets);
    }
}